home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 July / 1994-07b.d64 / 15 solitaire (.txt) next >
Commodore BASIC  |  2022-09-20  |  4KB  |  119 lines

  1. 10 rem copyright 1994 - compute publications intl ltd - all rights reserved
  2. 20 poke53265,peek(53265)and239:poke53296,1
  3. 30 dimcd(51),mx(3,3),my(3,3):r$="a234567890jqk":s$="[216][193][211][218]":cl$="[155][150]"
  4. 40 z$="[157][157][157][157][157][157][194][194]":f$="[146][145][157][213][192][192][192][192][201]"+z$+z$+z$+z$+"[157][157][157][157][157][157][202][192][192][192][192][203]"
  5. 50 z$="[157][157][157][157][157][157]  ":c$="[146][145][157]      "+z$+z$+z$+z$+"[157][157][157][157][157][157]      "
  6. 60 bl$="[146]    [157][157][157][157]    [157][157][157][157]    [157][157][157][157]    "
  7. 70 deffnrn(x)=x-(int(x/13)*13)+1:deffnsu(x)=int(x/13)+1
  8. 80 poke53280,0:poke53281,0:gosub960:fori=0to51:cd(i)=i:next
  9. 90 fori=0to51:j=52*rnd(0):x=cd(j):cd(j)=cd(i):cd(i)=x:next
  10. 100 pt=0:fori=0to3:forj=0to3:mx(i,j)=cd(pt):pt=pt+1:next:next
  11. 110 print"[147]"tab(30)"[159][213][192]total[192][201]"
  12. 120 fori=1to5:printtab(30)"[194][194]":next:printtab(30)"[202][192][192][192][192][192][192][192][203]"
  13. 130 print""tab(30)"[156][213][192]cards[192][201]"
  14. 140 fori=1to5:printtab(30)"[194][194]":next:printtab(30)"[202][192][192][192][192][192][192][192][203]"
  15. 150 print""tab(25)"[154]    [157][157][157][157] re [157][157][157][157]deal[157][157][157][157]    "
  16. 160 poke214,18:print:printtab(25)"[153]    [157][157][157][157]clr [157][157][157][157] all[157][157][157][157]    "
  17. 170 poke53296,0:poke53265,peek(53265)or16
  18. 180 foryy=0to3:forxx=0to3:cd=mx(xx,yy):gosub830:poke54296,15:gosub900
  19. 190 poke54296,0:my(xx,yy)=-1:next:next
  20. 200 dc=0:xx=0:yy=0:poke53269,1
  21. 210 gosub910
  22. 220 ff=0:cc=0:t=0
  23. 230 poke53248,xx*48+42:poke53249,yy*48+67
  24. 240 poke53287,(peek(53287)+8)and15
  25. 250 geta$:a=notpeek(56320)and31:ifa=0anda$=""then240
  26. 260 ifa$=chr$(13)ora=16then360
  27. 270 ifa$="[145]"ora=1thenyy=yy-1:ifyy=-1thenyy=3
  28. 280 ifa$=""ora=2thenyy=yy+1:ifyy=4thenyy=0
  29. 290 ifa$="[157]"ora=4thenxx=xx-1
  30. 300 ifa$=""ora=8thenxx=xx+1
  31. 310 if(yy=0oryy=3)andxx>4thenxx=0:goto230
  32. 320 ifxx<0andyy<>0andyy<>3thenxx=3
  33. 330 ifxx>3andyy<>0andyy<>3thenxx=0
  34. 340 ifxx<0thenxx=4
  35. 350 goto230
  36. 360 ifxx=4then740
  37. 370 ifmx(xx,yy)=99then240
  38. 380 s=fnsu(mx(xx,yy)):r=fnrn(mx(xx,yy))
  39. 390 ifr>9 andcc<>0 andff=0then240
  40. 400 ifr<9 andcc<>0 andff=1then240
  41. 410 ifr>9thenff=1
  42. 420 ifs<>csandcc<>0then240
  43. 430 cs=s:my(xx,yy)=-my(xx,yy):t=t+r*my(xx,yy)
  44. 440 cc=cc-1:cd$=c$:ifmy(xx,yy)+1thencd$=f$:cc=cc+2
  45. 450 ifcc=0thenff=0
  46. 460 poke646,7*rnd(0)+3:gosub900
  47. 470 poke54273,75:poke54296,15:poke54277,17:poke54278,245:poke54276,17
  48. 480 fori=1to50:next:gosub900:poke54276,0:poke54296,0
  49. 490 ifffthen520
  50. 500 gosub910:ift=15then530
  51. 510 goto240
  52. 520 ifcc<>4then240
  53. 530 px=xx:py=yy:foryy=0to3:forxx=0to3:ifmy(xx,yy)=-1then570
  54. 540 poke54277,0:poke54278,255:poke54296,6:poke54276,129
  55. 550 fori=0to50step2:poke54273,i:next:poke54273,0:poke54276,0:poke54296,0
  56. 560 cd$=c$:gosub900:cd$=bl$:gosub900
  57. 570 next:next
  58. 580 foryy=0to3:forxx=0to3:ifmy(xx,yy)=-1then630
  59. 590 z=99:ifpt<52thenz=cd(pt):pt=pt+1
  60. 600 my(xx,yy)=-1:mx(xx,yy)=z:dc=dc+1 :ifz=99then630
  61. 610 cd=z:gosub830:poke54296,15:gosub900:poke54296,0:gosub930
  62. 620 fori=0to200:next
  63. 630 next:next
  64. 640 ifdc<52thenxx=px:yy=py:t=0:goto210
  65. 650 poke53269,0:a$="you did it!":fork=1to3:fori=21to0step-1:poke214,i:print
  66. 660 poke646,8*rnd(1)+1:printtab(6)a$
  67. 670 forj=1to50:next:printtab(6)"[145]           ":next
  68. 680 x=21:ifk=3thenx=10
  69. 690 fori=0tox:poke214,i:print:poke646,8*rnd(1)+1:printtab(6)a$
  70. 700 forj=1to50:next:printtab(6)"[145]           ":next:next
  71. 710 poke646,15*rnd(0)+1:printtab(6)a$"[145]"
  72. 720 getaa$:ifaa$=""and(peek(56320)and16)=16then710
  73. 730 poke53269,1:goto90
  74. 740 ifyythen810
  75. 750 print""tab(30)"are you[157][157][157][157][157][157][157]sure? ";:poke204,0
  76. 760 fori=1to500:next:poke198,0
  77. 770 a=notpeek(56320)and31:geta$:ifa$=""anda=0then770
  78. 780 poke204,1:print""tab(30)"       [157][157][157][157][157][157][157]       ";
  79. 790 ifa$<>chr$(13)anda<>16then230
  80. 800 print"[147]":goto90
  81. 810 px=xx:py=yy:cd$=c$:foryy=0to3:forxx=0to3:my(xx,yy)=-1:gosub900:next:next
  82. 820 t=0:xx=px:yy=py:goto210
  83. 830 fl=0:iffnrn(cd)=10thenfl=1
  84. 840 cd$=""+mid$(cl$,fnsu(cd),1)
  85. 850 iffltheny$="10":goto870
  86. 860 y$=mid$(r$,fnrn(cd),1)+" "
  87. 870 x$=mid$(s$,fnsu(cd),1):cd$=cd$+y$+" "+x$+"[157][157][157][157]    [157][157][157][157]    [157][157][157][157]"+x$+" "
  88. 880 ifflthencd$=cd$+y$:return
  89. 890 cd$=cd$+" "+left$(y$,1):return
  90. 900 poke214,yy*6:print:printtab(xx*6+1)""cd$:return
  91. 910 poke214,4:print:printtab(31)"";
  92. 920 printa$(int(t/10))"[145][145][145][145][145]"a$(t-int(t/10)*10)
  93. 930 poke214,13:print:printtab(31)"[158]";
  94. 940 z=52-pt:printa$(int(z/10))"[145][145][145][145][145]"a$(z-int(z/10)*10)
  95. 950 return
  96. 960 fori=0to9:readx$:forj=1to14step3:fork=0to2
  97. 970 ifmid$(x$,j+k,1)=" "thena$(i)=a$(i)+"[146] "
  98. 980 ifmid$(x$,j+k,1)="."thena$(i)=a$(i)+" "
  99. 990 next:a$(i)=a$(i)+"[157][157][157]":next:next
  100. 1000 data".... .. .. ...."
  101. 1010 data" . ..  .  . ..."
  102. 1020 data"...  .....  ..."
  103. 1030 data"...  . ..  ...."
  104. 1040 data"  .. ....  .  ."
  105. 1050 data"....  ...  ...."
  106. 1060 data"....  .... ...."
  107. 1070 data"...  . . .  .  "
  108. 1080 data".... ..... ...."
  109. 1090 data".... ....  .  ."
  110. 1100 fori=0to63:readj:poke896+i,j:next
  111. 1110 poke53264,0:poke53269,0:poke53275,0:poke53287,3:poke2040,14:return
  112. 1120 data192,24,0,224,56,0,112,112
  113. 1130 data0,56,224,0,29,192,0,15
  114. 1140 data128,0,7,0,0,15,128,0
  115. 1150 data29,192,0,56,224,0,112,112
  116. 1160 data0,224,56,0,192,24,0,0
  117. 1170 data0,0,0,0,0,0,0,0,0,0,0,0
  118. 1180 data0,0,0,0,0,0,0,0,0,0,0,0
  119.